package org.yaac.server.util;

import java.util.LinkedList;
import java.util.List;

/**
 * @author Max Zhu (thebbsky@gmail.com)
 *
 */
public class GWTUtil {

	/**
	 * parse non-GWT underlying to GWT compatible classes
	 * 
	 * for example, Objectify.ToObjectIterable, and java.util.Hashmap@Value are not in GWT emulation list
	 * 
	 * @param <T>
	 * @param from
	 * @return
	 */
	public static <T> List<T> ensureGWTCompatible(Iterable<T> from) {
		List<T> toList = new LinkedList<T>();
		
		for (T item : from) {
			toList.add(item);
		}
		
		return toList;
	}
	
}
